$(document).ready(function () {
    var ticketObj;
    var usr_sign = untils.getQueryString("usr_sign");
    var usr_nonce = untils.getQueryString("usr_nonce");
    var usr_ts = untils.getQueryString("usr_ts");
    var checkToken = {
        usr_sign: usr_sign,
        usr_nonce: usr_nonce,
        usr_ts: usr_ts
    };
    var usr_info = JSON.parse(untils.getQueryString("wxUserInfo"));
    var activityID = "40298198605804dc0160791fc3775299";
    var shareTxt = "一阳生，福利来！玩游戏赢免费旅游，温暖你整个冬季~";
    var shareLink = "http://tpn.gzl.com.cn/static/game/WinterSolstice/html/playgame.html";
    var over_music = document.getElementById('over_music');

    

    function playMusic() {
        var player = $("#game_music")[0]; /*jquery对象转换成js对象*/
        if (player.paused) { /*如果已经暂停*/
            player.play(); /*播放*/
        } else {
            player.pause();/*暂停*/
        }
    }

    $('.td_bg img').each(function(){
        var c = $(this).attr('c');
        var r = $(this).attr('r');
        $(this).on('click', function() {
            // console.log(this,c,r)
            jiancha(this, c, r)
        })
    })


    //点击开始游戏
    $('.start').click(function(){
       
    })


    //一键分享
    $('.share_btn').click(function(){
        $('.fail_bg').hide();
        $('.shareTip').show();
    })
    $('.no_share_btn').click(function(){
        $('.no_chance_bg').hide();
        $('.shareTip').show();
    })
    $('.no_chance_box .bomb_box_bg').click(function(){
        $('.no_chance_bg').show();
        $('.shareTip').hide();
    })


    // 点击抽奖
    $('.lottery').click(function(){
        var check_toke = JSON.stringify(checkToken);
        window.location = "http://tpn.gzl.com.cn/static/game/WinterSolstice/html/turnplate.html?checkToken=" + encodeURIComponent(check_toke) + "&ticketObj=" + JSON.stringify(ticketObj);
    })

    $('.more_surpise').click(function(){
        window.location = "http://weixin.gzl.cn/index.html";
    })

    /*GA点击统计*/
    var eventCategory = window.location.pathname.split('/')[3];
    $('.S_analyticsLabel').each(function () {
        $(this).click(function () {
            ga('send', 'event', eventCategory, 'click', $(this).attr('label'));
            ga('gz.send', 'event', eventCategory, 'click', $(this).attr('label'));
        });
    });

})








